<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "tbl_yzm".
 *
 * @property int $id
 * @property string $phone 手机号
 * @property string $code 验证码
 * @property int $status 1发送失败，2发送成功
 * @property int $created_at 创建时间
 */
class YzmModel extends \yii\db\ActiveRecord
{
    /**
     * 超时
    */
    const Maxtime=60*60;


    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'tbl_yzm';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['code'], 'required'],
            [['time'], 'integer'],
            [['phone'], 'string', 'max' => 11],
            [['code'], 'string', 'max' => 6],
            [['status'], 'string', 'max' => 1],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'phone' => 'Phone',
            'code' => 'Code',
            'status' => 'Status',
            'time' => 'Created At',
        ];
    }
}
